package org.inote.service.impl;

import org.inote.dao.CommentMapper;
import org.inote.pojo.tablePojo.Comment;
import org.inote.service.CommentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service("CommentService")
public class CommentServiceImpl implements CommentService {
    @Resource
    private CommentMapper commentMapper;

    @Override
    public boolean addComment(Comment comment) {
        boolean success = true;
        try{
            int i = commentMapper.addComment(comment);
        } catch (Exception e){
            success = false;
        }
        return success;
    }

    @Override
    public boolean deleteComment(Integer commentId) {
        commentMapper.deleteComment(commentId);
        return true;
    }

    @Override
    public List<Comment> queryNoteComments(Integer noteId) {
        return commentMapper.queryNoteComments(noteId);
    }

}
